package com.design.cjm.test;

/**
 * @Author: Jie Ming Chen
 * @Date: 2019-02-21
 * @Version 1.0
 */
public class SynchronizedObject {

    private static SynchronizedObject object = new SynchronizedObject();

    public static void test() {
        synchronized (SynchronizedObject.class) {
            System.out.println("加锁1");
            object = null;
            synchronized (SynchronizedObject.class) {
                System.out.println("加锁2");
            }
            synchronized (object) {
                System.out.println("加锁3");
            }
        }
    }

    public static void main(String[] args) {
        test();
    }

}
